package mysql.work01;

import java.time.LocalDateTime;

public class AccountTest {
    public static void main(String[] args) {
        Account a = new Account("123456", "aaa", 9999);
        BankService.accountMap.put(a.getAccountNumber(),a);

        LocalDateTime date1 = LocalDateTime.of(2025, 1, 5, 6, 30, 10);
        LocalDateTime date2 = LocalDateTime.of(2025, 2, 5, 6, 30, 10);
        LocalDateTime date3 = LocalDateTime.of(2025, 3, 5, 6, 30, 10);
        LocalDateTime date4 = LocalDateTime.of(2025, 4, 5, 6, 30, 10);
        LocalDateTime date5 = LocalDateTime.of(2026, 4, 5, 6, 30, 10);
        //存款
        TransactionRecord transactionRecord1 = new TransactionRecord(1, date1, TransactionType.DEPOSIT, 1000, "123456");
        //取款
        TransactionRecord transactionRecord2 = new TransactionRecord(2, date2, TransactionType.WITHDRAWAL, 500, "123456");
        //收入
        TransactionRecord transactionRecord3 = new TransactionRecord(3, date3, TransactionType.TRANSFER_IN, 200, "123456");
        //支出
        TransactionRecord transactionRecord4 = new TransactionRecord(4, date4, TransactionType.TRANSFER_OUT, 100, "123456");

        BankService bankService = new BankService();
        bankService.executeTransaction(transactionRecord1);
        bankService.executeTransaction(transactionRecord2);
        bankService.executeTransaction(transactionRecord3);
        bankService.executeTransaction(transactionRecord4);

        //查看交易日志列表
        BankService.transList.forEach(System.out::println);
        //
        String filePath="E:\\2025-cx\\project\\PJ\\J01\\Javase\\Temp\\account.csv";
        bankService.exportAuditLog("123456",date1,date5,filePath);
    }
}
